You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(requests): give admin accounts unlimited media requests - #5926
Other clients: Apple N/A (no client change; titles stay requestable for admins because the server decides); Android N/A (same); Roku N/A (same)
Server admins hit the same media request quota as every other account. With the default of 5 requests per 7 days, an admin who has made five requests can't request another title until the window passes, unless someone has set that admin's own account limit to unlimited. This change exempts admin accounts from the quota, for direct requests and watchlist requests alike, and the web admin now shows their limit as unlimited.
Approach
requests.LayeredPolicy resolves an account's server, group and account request settings, and both readers of request authority use it: live requests (resolvePolicy) and the backup restore check (requestsWider). It now takes the account's admin role and marks an admin's policy unlimited after the layers are applied. Every path that checks the quota reads that policy: request creation, watchlist requests, a title's request state, and the admin usage view.
Only the quota changes. Requests turned off server-wide, the account's requests switch, an account-level blocked mode, approval, and duplicate checks still apply to admins.
The web admin mirrors the server's resolution in resolveRequestTerms, which now reports an admin account's limit as unlimited. When editing an admin account's Requests card, the limit field is hidden because no limit applies. A saved account limit stays in the database and applies again if the account stops being an admin. The change adds no UI strings.
This changes two validated cases on purpose. #1202 C1 ("Enforce request limits") and #1203 C1 ("configure per-user limits") still hold for every account except admins. Their results don't say whether the limited accounts were admins; a re-test that uses an admin account will now see no limit, and the web admin no longer offers a limit for admin accounts.
Validation
Go: a table test in internal/requests checks that an admin's policy is unlimited under server, group and account quotas, and that an account block still blocks an admin. It fails without the change.
Full pre-PR gate from CONTRIBUTING.md: all passed. verify-actionlint, verify-shellcheck and verify-prometheus-rules were not run because no workflow, script or rule changed.
Web admin, by hand: ran this branch and origin/main against fresh databases with requests on and the default quota, signed in as the admin, and compared the Requests card, its editor, and the Overview tab at desktop and phone width (captures below).
Code review: the dual review described under AI Disclosure.
Surface and build: web admin (Admin → Users → admin account), desktop 1440 px and phone 390 px. Before: origin/main at 835131f. After: this branch at 4a823a1.
Risks
An admin's saved account limit no longer has any effect while the account is an admin. Admins who relied on a quota to slow down their own requests lose that; the requests switch and approval remain for that. No migration or API contract change.
Checklist
I read and can explain the complete diff.
This pull request addresses one concern.
Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
The Evidence section shows every change a user can see, or how I checked a change nobody sees.
AI Disclosure
Harness: Claude Code (in T3 Code)
Tool(s): Claude Code, Codex CLI, Playwright
Model(s): claude-opus-5-5 (implementation and review), gpt-6.2-sol (review via Codex CLI)
Involvement: Fully AI-generated, human verified
Adversarial review: two independent reviews (claude-opus-5-5 and gpt-6.2-sol) of the branch diff on correctness, standards and spec, then of the later editor change. Fixed: the web admin still showed a quota for admins; the architecture doc described the old rule; the editor offered a limit for admins that no longer applied. Dismissed: separate backup and request-creation tests (the behavior is covered once, through LayeredPolicy), a parameter struct for LayeredPolicy (two callers), and a role change made mid-edit from another device.
Note
Give admin accounts unlimited media requests
Admin users now bypass all quota layers (server, group, account) and receive unlimited request policies in both backend and web resolution. Blocking and approval rules still apply.
LayeredPolicy in service.go takes an admin flag and sets the policy's unlimited flag; the live resolver skips the request-count store for admins.
resolveRequestTerms in requestAccess.ts accepts a role and replaces the resolved quota with an unlimited one for admins. The admin editor hides quota inputs via the new showLimit prop on RequestLimitFields.
Adds table-driven tests in group_limits_test.go covering server, group, account quotas and account-level blocking for admins.
Behavioral Change: admin usage is not counted toward quotas; account-level block modes still block admins. Backup request-policy evaluation in credentials_authority.go mirrors the new behavior.
Server admins no longer hit the server, group, or account request quota.
LayeredPolicy marks an admin's policy unlimited, so request creation,
watchlist requests, title request state, the admin usage view and the
backup authority check all agree. An account block, the requests switch
and approval still apply to admins.
The web admin shows an admin account's limit as unlimited and hides the
limit field when editing one, since no limit applies.
silo-triageBot
added
the
size/L
200–499 added + deleted lines (all files); change volume, not priority.
label
Dec 6, 2026
Admin request policies now use unlimited quotas across backend and web resolution. Existing blocking and approval behavior remains. Admin user screens hide quota controls, and the architecture documentation describes the policy.
The backend passes admin status into layered policy resolution and marks admin policies as unlimited without clearing blocks. Tests cover server, group, and account quotas, plus account blocks. The documentation describes the quota exemption and retained blocking rules.
Web request terms and admin controls web/src/lib/requestAccess.ts, web/src/pages/admin-users/detail/access/RequestsCard.tsx, web/src/components/admin/RequestLimitFields.tsx
Web request-term resolution sets admin quotas to unlimited and preserves approval resolution. Admin user screens pass the role into resolution and hide quota fields while retaining approval controls.
Server admins are exempted from request quotas while request switches, blocks and approval rules still apply. No concrete merge-blocking risk was found in the changed backend policy, the web resolver or the admin editor.
Security architecture risk: Low · up to 4a823
Removing the quota for server admins is intentional, including for automatic watchlist requests. Server-wide disablement, the account requests switch, explicit blocks, approval, and duplicate checks still apply. The remaining risk is narrow: a request already in flight can use an admin exemption it read just before the account was demoted.
Retained concerns
Trivial · security · inferred: A demotion does not fence a create that already resolved the account as an admin. If the role change commits after that read but before the request write, the repository can still accept the create without checking the reinstated quota. At the merge base, an admin with a finite quota still had that quota checked in the write transaction. Fresh policy reads enforce the post-demotion terms, and the queued watchlist loop rereads policy for each candidate, so the exposure is limited to already-resolved creates, not the rest of the queue.
inferred — An eligible server-admin account can create more distinct direct or watchlist requests than its old quota allowed. If auto-approval is enabled, more requests can reach fulfillment without manual approval. That volume increase is inherent in the intended exemption; it does not grant quota relief to other accounts or remove duplicate protection.
Security Findings and Attack Paths
inferred — A formerly capped admin can have a create admitted under the old role if demotion overlaps the interval between policy resolution and persistence. Session revocation in the inspected demotion path does not revalidate a create that has already passed policy resolution. There is no new path here for an account already read as non-admin to select unlimited status.
Trust Boundaries and Controls
observed — The subject account’s server-side user record, not submitted media fields or the web editor, determines the exemption. The create path separately gates profile access and content eligibility, and the layered quota override does not clear request blocks or change approval.
Public contracts
observed — The request-usage API reports the subject account’s effective unlimited policy rather than a finite usage allowance for admins. The Go policy resolver now requires callers to supply admin status.
Dependencies
observed — Backup credential carry uses the same request resolver as live enforcement. It compares a repeatable-read snapshot of live credentials and their authority with staged restored authority, after preserving stricter switches and before writing carried credentials. It compares against that snapshot, not a fresh live read at cutover.
Data and control flow
observed — The service resolves the caller account’s terms, checks enablement and blocking, and chooses pending or approved status. The repository commits the request and its events before the service dispatches an auto-approved request. Unlimited status removes the quota check, not those other steps.
Resilience and Maintainability Implications
inferred — After demotion, fresh policy reads resume counting qualifying requests in the applicable window, including rows created while the account was exempt. The exemption skips enforcement and usage calculation while active; it does not erase request history or give the account a clean quota window on demotion. This recovery does not stop a write already admitted under the old policy.
Rollout and rollback
inferred — Operators who used a finite or zero quota to constrain an admin must use the account requests switch to stop that account, or server-wide disablement to stop requests globally. The request service checks those controls during creation; the upgrade does not turn a zero quota into a block. Returning to merge-base code restores quota enforcement but does not undo requests already committed or sent for fulfillment.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "feat(requests): give admin accounts unlimited media requests" matches the main change: admin accounts are exempted from the media request quota via LayeredPolicy and the web admin shows the…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description is specific and related to the changeset. It explains that server admin accounts are now exempt from the media request quota, and it names the changed code paths. It covers the Layered…
Full details: Title check
Explanation
The title "feat(requests): give admin accounts unlimited media requests" matches the main change: admin accounts are exempted from the media request quota via LayeredPolicy and the web admin shows their limit as unlimited. It is specific and conventional, and it does not describe anything absent from the changeset.
Full details: Description check
Explanation
The description is specific and related to the changeset. It explains that server admin accounts are now exempt from the media request quota, and it names the changed code paths. It covers the LayeredPolicy admin flag, resolveRequestTerms with a role, the showLimit prop in the admin editor, the table tests in internal/requests, and the backup restore check. It also states the behavior that still applies to admins: blocking, approval, and the requests switches. It includes validation steps, evidence, risks, and the effect on validated test cases.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments
1
A demotion does not fence a create that already resolved the account as an admin. If the role change commits after that read but before the request write, the repository can still accept the create without checking the reinstated quota. At the merge base, an admin with a finite quota still had that quota checked in the write transaction. Fresh policy reads enforce the post-demotion terms, and the queued watchlist loop rereads policy for each candidate, so the exposure is limited to already-resolved creates, not the rest of the queue.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: a71ac767-93c6-4ea6-ab8d-89e258e3f463
Commits
Reviewing files that changed from the base of the PR and between 835131f and 4a823a1.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
Re CodeRabbit's trivial note on a demotion racing an in-flight create: leaving this as is. The same window already exists for any account whose limit changes from "No limit" to a custom one mid-create; at most that one request skips the quota, and every later request reads the new policy. Fencing it would mean re-reading the role inside the write transaction, which is more than a one-request window warrants.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enhancementNew feature or requestgoPull requests that update go codejavascriptPull requests that update javascript codepriority: P2Limited scope, workaround exists, or polishsize/L200–499 added + deleted lines (all files); change volume, not priority.
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Related issue: N/A (idea: Discussion #5925)
Validation tasks: changes #1202 C1; changes #1203 C1
Other clients: Apple N/A (no client change; titles stay requestable for admins because the server decides); Android N/A (same); Roku N/A (same)
Server admins hit the same media request quota as every other account. With the default of 5 requests per 7 days, an admin who has made five requests can't request another title until the window passes, unless someone has set that admin's own account limit to unlimited. This change exempts admin accounts from the quota, for direct requests and watchlist requests alike, and the web admin now shows their limit as unlimited.
Approach
requests.LayeredPolicyresolves an account's server, group and account request settings, and both readers of request authority use it: live requests (resolvePolicy) and the backup restore check (requestsWider). It now takes the account's admin role and marks an admin's policy unlimited after the layers are applied. Every path that checks the quota reads that policy: request creation, watchlist requests, a title's request state, and the admin usage view.Only the quota changes. Requests turned off server-wide, the account's requests switch, an account-level
blockedmode, approval, and duplicate checks still apply to admins.The web admin mirrors the server's resolution in
resolveRequestTerms, which now reports an admin account's limit as unlimited. When editing an admin account's Requests card, the limit field is hidden because no limit applies. A saved account limit stays in the database and applies again if the account stops being an admin. The change adds no UI strings.This changes two validated cases on purpose. #1202 C1 ("Enforce request limits") and #1203 C1 ("configure per-user limits") still hold for every account except admins. Their results don't say whether the limited accounts were admins; a re-test that uses an admin account will now see no limit, and the web admin no longer offers a limit for admin accounts.
Validation
internal/requestschecks that an admin's policy is unlimited under server, group and account quotas, and that an account block still blocks an admin. It fails without the change.verify-actionlint,verify-shellcheckandverify-prometheus-ruleswere not run because no workflow, script or rule changed.origin/mainagainst fresh databases with requests on and the default quota, signed in as the admin, and compared the Requests card, its editor, and the Overview tab at desktop and phone width (captures below).Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-5926/
Surface and build: web admin (Admin → Users → admin account), desktop 1440 px and phone 390 px. Before:
origin/mainat 835131f. After: this branch at 4a823a1.Risks
An admin's saved account limit no longer has any effect while the account is an admin. Admins who relied on a quota to slow down their own requests lose that; the requests switch and approval remain for that. No migration or API contract change.
Checklist
AI Disclosure
LayeredPolicy), a parameter struct forLayeredPolicy(two callers), and a role change made mid-edit from another device.Note
Give admin accounts unlimited media requests
LayeredPolicyin service.go takes an admin flag and sets the policy's unlimited flag; the live resolver skips the request-count store for admins.resolveRequestTermsin requestAccess.ts accepts a role and replaces the resolved quota with an unlimited one for admins. The admin editor hides quota inputs via the newshowLimitprop onRequestLimitFields.Macroscope summarized 4a823a1.